<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui">
    <head>
        <title>TODO supply a title</title>
    </head>
    <h:body><ui:composition template="/resources/template/myTemplate.xhtml">
            <ui:define name="content">              
                <h:form>
                    <h3>Register new bank account</h3>
                    <!--<p:messages id="messages" globalOnly="false" showDetail="false" autoUpdate="true" />--> 
                    <h:panelGrid columns="2">
                        <h:outputLabel value="Bank Name : "/>
                        <h:inputText value="#{bankAccManagedBean.bankAcc.bankName}" required="true"/>

                        <h:outputLabel value="Account number : "/>
                        <h:inputText value="#{bankAccManagedBean.bankAcc.accNum}" required="true"/>

                        <h:outputLabel value="Currency : "/>
                        <h:selectOneMenu value="#{bankAccManagedBean.bankAcc.currency}" required="true">
                            <f:selectItems value="#{bankAccManagedBean.currencyMB.currencyList}" var="cur"
                                           itemLabel="#{cur.shortName}" itemValue="#{cur.shortName}" />
                            <f:converter converterId="com.bionic.ce.CurrencyConverter"/>
                        </h:selectOneMenu>	       

                        <h:outputLabel value="SWIFT : "/>
                        <h:inputText value="#{bankAccManagedBean.bankAcc.swift}" required="true"/>

                        <h:outputLabel value="Correspondent Bank : "/>
                        <h:inputText value="#{bankAccManagedBean.bankAcc.correspondentBank}" required="true"/>

                        <p:commandButton value="Register" action="#{bankAccManagedBean.doCreateBankAcc()}"/>
                    </h:panelGrid>
                </h:form>
            </ui:define>

        </ui:composition>
    </h:body>
</html>